﻿using System;

namespace Gp.Scripts.Core
{
    public static class EnumUnitFieldExtension
    {
        public static string StatName(this StatField field)
        {
            return Enum.GetName(typeof(StatField), field);
        }

        public static int StatId(this StatField field)
        {
            return (int) field;
        }

        private static object Map(this BonusField field)
        {
            return field switch
            {
                // BonusField.FastMove => SkillField.FastMove,
                // BonusField.Damage => SkillField.Damage,
                //
                // BonusField.MeleeDamage => SkillField.MeleeDamage,
                // BonusField.RangedDamage => SkillField.RangedDamage,
                //
                //
                // BonusField.DamageReduce => SkillField.DamageReduce,
                // BonusField.DurabilityHurt => SkillField.DurabilityHurt,
                // // BonusField.FullShootSuppressGrow => SkillField.SuppressGrow,
                //
                //
                // BonusField.DamageReceive => SkillField.DamageReceive,
                _ => throw new ArgumentOutOfRangeException(nameof(field), field, "错误的属性")
            };
        }


        /// <summary>
        /// 仅用于编辑器拓展
        /// </summary>
        /// <param name="field"></param>
        /// <returns></returns>
        public static string LabelName(this CostField field)
        {
            return field switch
            {
                CostField.ActionTime     => "进攻点",
                _                    => ""
            };
        }

        public static int CostOrder(this CostField field)
        {
            return field switch
            {
                CostField.ActionTime     => 3,
                _                    => 5
            };
        }
    }
}